%% Function to divide the list of papers into groups

function groups = random_pair(indices)
 % Randomly shuffle indices
    indices = indices(randperm(length(indices)));
    n = length(indices);
    groups = {}; % Initialize the cell array to hold groups
    
    i = 1;
    while i <= n
        % Check for the remainder group of three
        if i == n - 2
            groups{end+1} = indices(i:i+2);
            break;
        else
            % Create a group of two
            groups{end+1} = indices(i:i+1);
            i = i + 2;
        end
    end

end